package com.edu.cdp.config;

import com.edu.cdp.utils.CodeUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * 将工具类注入spring容器，使哈希缓存生效，
 * 不用new对象，始终调用一个codeUtils对象
 */
@Configuration
@ComponentScan(basePackages = "com.edu.cdp.config")
public class BeanConfig {
    @Bean
    public CodeUtils getCodeUtils() {
        return new CodeUtils();
    }
}